﻿/*********************************************************
 * Copyright(c) 2012-2015
 * Author:wangzhonghai
 * description：
 *       1、
 * history：
 *       1、wangzhonghai - 2015/5/5 19:43:48 - Add 
 * *******************************************************/

using AopAndIocDemo.Biz.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;

namespace AopAndIocDemo.Biz.Logging
{
    public class LoggerService : ILogger
    {
        private readonly ILog _logInfo;
        private readonly ILog _logError;

        public LoggerService()
        {
            _logInfo = log4net.LogManager.GetLogger("info");
            _logError = log4net.LogManager.GetLogger("error");
        }

        public void Warn(string msg)
        {
            _logInfo.Warn(msg);
        }

        public void Info(string msg)
        {
            _logInfo.Info(msg);
        }

        public void Debug(string msg)
        {
            _logInfo.Debug(msg);
        }

        public void Error(string msg)
        {
            _logError.Error(msg);
        }

        public void Error(string message, Exception exception)
        {
            _logError.Error(message, exception);
        }
    }
}